package com.wowangz.cms.common.easyui.tree;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @author leiyang3
 *
 */
public class TreeInfo {
	
	private long id;
	private String text;
	private String state = TreeConstant.TreeState.OPEN;
	//扩展属性
	private Map<String,Object> attributes = null;
	private List<TreeInfo> children = null;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public Map<String, Object> getAttributes() {
		return attributes;
	}
	public void addAttribute(String key, String value) {
		if(attributes == null){
			attributes = new HashMap<String, Object>();
		}
		attributes.put(key, value);
	}
	public List<TreeInfo> getChildren() {
		return children;
	}
	public void setChildren(List<TreeInfo> children) {
		this.children = children;
	}
}
